<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>HTML5 媒体</title>
</head>
<body>
<video src="">
    <a href="">Download this video.</a>
</video>
<video src="">
    <source src="">
    <a href="">Download this video.</a>
</video>
<video src="">
    <source src="">
    <source src="">
    <a href="">Download this video.</a>
</video>
<video src="">
    <source src="" type="video/mp4">
    <source src="" type="video/webm">
    <a href="">Download this video.</a>
</video>
<video src="">
    <source src="" type="video/mp4; codecs='avc1.4D401E, mp4a.40.2'">
    <source src="" type="video/webm; codecs='vp8.0, vorbis'">
    <a href="">Download this video.</a>
</video>
<video src="" controls="controls"></video>
<video src="" controls="controls" preload="auto"></video>
<video src="" controls="controls" preload="auto" poster=""></video>
<video id="bbb-video" src=""></video>
<script>
    var video = document.getElementById('bbb-video');
    video.play();
    video.pause();
</script>
<script>
    video = document.createElement('video');
    if (video.canPlayType('video/webm') == 'probably') {
        video.src = 'bbb.webm';
    } else {
        video.src = 'bbb.mp4';
    }
    video.play();
    video.pause();

    if (video.paused) {
        video.play();
    } else {
        video.pause();
    }

    if (video.muted) {
        video.muted = false;
    } else {
        video.muted = true;
    }

    video.muted = !video.muted;

    //    incorrect
    video.src = 'new-media.mp4';
    video.play();

    video.src = 'new-media.mp4';
    video.load();
    video.play();

    function mediaPaused(e) {
        alert('You paused the video!');
    }
    video.addEventListener('pause', mediaPaused);

    function mediaPausedPlaying(e) {
        if (e.type == 'pause') {
            alert('You paused the video!');
        } else {
            alert('You\'re playing the video!');
        }
    }
    video.addEventListener('pause', mediaPausedPlaying);
    video.addEventListener('playing', mediaPausedPlaying);
</script>
</body>
</html>